package com.phpxiu.app.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.phpxiu.app.kkylive.R;
import com.phpxiu.app.model.list.LoveState;

import java.util.List;

/**
 * Created by WuJinZhou on 2016/6/4.
 */
public class LoveStateListAdapter extends BaseAdapter<LoveState> {

    public LoveStateListAdapter(Context context, List<LoveState> data) {
        super(context, data);
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        LoveState state=data.get(position);
        if(convertView==null){
            convertView=mInflater.inflate(R.layout.user_info_love_state_list_item_view,null);
        }
        TextView stateTv=(TextView)convertView.findViewById(R.id.love_state_tv);
        stateTv.setText(state.getTitle());
        convertView.setTag(state);
        stateTv.setSelected(state.isSelected());
        return convertView;
    }
}
